import {Component, OnInit} from '@angular/core';
import {BladeService} from '../../../shared/blade.service';
import {BladeData} from '../../../shared/blade/blade-data';
import {FarmListComponent} from './farm-list/farm-list.component';
import {Observable} from 'rxjs/Observable';


@Component({
  selector: 'app-farm',
  templateUrl: './farm.component.html',
  styleUrls: ['./farm.component.css'],
  providers: [BladeService]
})
export class FarmComponent implements OnInit {
  // currentBlade: Blade;

  constructor(public bladeService: BladeService) {
  }

  ngOnInit() {
    this.createFarmListtBlade()
  }

  /**
   * 创建风场列表弹出层
   *
   *
   * @memberof DicComponent
   */
  createFarmListtBlade() {
    let data: BladeData = new BladeData();
    data.id = 'farmList';
    data.title = '风场列表';
    data.isClosingDisabled = true;
    let farmListBlade = this.bladeService.createBlade(FarmListComponent, data);
    this.bladeService.showBlade(farmListBlade);
  }

  /**
   * 是否可以离开
   *
   *
   * @memberof DicComponent
   */
  canDeactivate(): boolean | Observable<boolean> | Promise<boolean> {
    return true;
  }

}


// WEBPACK FOOTER //
// ./src/app/module/basic/farm/farm.component.ts
